<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html id="iframe">
<head>
    <meta charset="utf-8"/>

    <title><?php echo C('sitename');?>55555</title>

    <meta name="renderer" content="webkit">
    <meta name="format-detection" content="telephone=no,email=no"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <meta name="telephone=no" content="format-detection">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no"/>

    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">

    <link rel="stylesheet" type="text/css" href="/Public/Home/css/lib.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Home/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Home/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Home/css/main.css">
    <link rel="stylesheet" type="text/css" href="/Public/Home/css/page.css"/>
    <link rel="stylesheet" href="/Public/tables/tables.css">

</head>
<style>
    html{
        overflow-y: scroll !important;
        height: 35rem;
    }
    body {
        height: 35rem !important;
        overflow-y: scroll;
        margin: 0;
    }

    .button {
        display: inline-block;
        width: 3rem;
        height: 0.8rem;
        line-height: 0.8rem;
        font-size: 0.9rem;
        background: -webkit-linear-gradient(#818078, #292928);
        background: -o-linear-gradient(#818078, #292928);
        background: -moz-linear-gradient(#818078, #292928);
        background: linear-gradient(#818078, #292928);
    }

    .leftRight .nav, .leftRight .content {
        padding: 0 !important;
    }

    .content p {
        display: inline-block;
    }

    .keyborad {
        display: none;
        position: absolute;
        top: 33px;
        left: 0px;
        z-index: 10;
        padding: 3px;
        margin: 0 !important;
        border-radius: 6px;
        background-color: #6a6e71;
        width: 100%;
    }

    .keyborad p {
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }

    .keyborad p span {
        display: inline-block;
        width: 13%;
        height: 40px;
        line-height: 40px;
        background-color: #293039;
        color: #FFF;
        text-align: center;
        border-radius: 3px;
    }

    .keyborad strong {
        display: inline-block;
        width: 15%;
        border-radius: 3px;
        height: 40px;
        line-height: 40px;
        color: #FFF;
    }

    .keyborad .qc, .keyborad .jt, .keyborad .fs, .keyborad .close {
        border: 1px solid #ffe668;
        background-color: #262626;
    }

    .keyborad strong {
        display: inline-block;
        width: 23.5%;
        border-radius: 3px;
        height: 40px;
        line-height: 40px;
        color: #ffe668;
    }
    .tb-continer .title {
        height: 1rem;
        line-height: 1rem;
        text-align: center;
        background: #333;
        color: #fff;
    }
</style>
<body>


<!--弹窗-北京赛车-->
<link rel="stylesheet" type="text/css" href="/Template/Home/Run/css/zhicwl-z.css"/>

<style>
    .zhicwl-qiejlf-tab-04 .zhicwl-akodr dl dt {
        width: 33%;
        margin-bottom: 6px;
    }

    .zhicwl-qiejlf-tab-05 .zhicwl-akodr dl dt {
        width: 100%;
    }

    .zhicwl-qiejlf-tab-05 .zhicwl-akodr dl dt:nth-of-type(10) {
        width: 100%;
    }

    .zhicwl-qiejlf-tab-05 .zhicwl-akodr dl dt span {
        font-weight: normal;
    }

    .zhicwl-qiejlf-tab-06 .zhicwl-akodr dl dt {
        width: 20%;
    }
    .input-chatting{
        width: 100%;
        padding: 15px 12px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 9999999;
        background: #f7f7f7;
    }
    .input-chattings{
        width: 100%;
        padding: 15px 12px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        bottom: 0;
        z-index: 9999999;
        background: #f7f7f7;
    }
    .input-chatting >img{
        width: 24px;
    }
    .input-chatting input{
        flex: 1;
        height: 36px;
        border-radius: 4px;
        margin: 0 8px;
        padding: 0 9px;
        box-sizing: border-box;
    }
    .input-chatting button{
        color: #fff;
        background-color: #08c261;
        border-radius: 3px;
        border: none;
        outline: none;
        height: 28px;
        padding: 2px 18px;
        box-sizing: content-box;
    }
    .input-chattings >img{
        width: 24px;
    }
    .input-chattings input{
        flex: 1;
        height: 36px;
        border-radius: 4px;
        margin: 0 8px;
        padding: 0 9px;
        box-sizing: border-box;
    }
    .input-chattings button{
        color: #fff;
        background-color: #08c261;
        border-radius: 3px;
        border: none;
        outline: none;
        height: 28px;
        padding: 2px 18px;
        box-sizing: content-box;
    }
    .menu-ul-t{
        width: 90px;
        position: fixed;
        display: none;
        top: 56px;
        right: 12px;
        padding: 8px;
        background: #3a3737;
        opacity: 0.98;
        border-radius: 5px;
        z-index: 9999999999;
    }
    .menu-ul{
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .menu-ul dd{
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: center;
        padding: 4px 0;
    }
    .menu-ul dd>a{
        width: 100%;
        display: flex;
        align-items: center;
        box-sizing: border-box;
    }
    .menu-ul a > img{
        width: 15px;
        box-sizing: content-box;
        padding-right: 10px;
    }
    .menu-ul a p{
        flex: 1;
        padding: 0 0 6px 0.6rem;
        box-sizing: border-box;
        color: #fff;
        font-size: 13px;
        letter-spacing: 5px;
        border-bottom: 1px solid #e7e7e7;
    }
    .white_content, .white_content1, .white_content2, .white_content3, .white_content4 {
        position: absolute;
        bottom: 0;
        width: 100vw;
        height: 60vh;
        bottom: -100vh;
        left: 0;
        background-color: #fff;
        z-index: -1002111111;
        overflow: auto;
        border-radius: 6px 6px 0 0;
        opacity: 0;

    }
    .active-white{
        position: fixed;
        width: 100vw;
        height: 60vh;
        bottom: 0;
        left: 0;
        z-index: 1002111111;
        opacity: 1;
        transition: all 0.72s ease-in-out;
    }

    .close, .close1, .close2, .close3, .close4 {
        display: none;
        width: 0.88rem;
        height: 2.09rem;
        position: fixed;
        left: 50%;
        bottom: 59.3%;
        z-index: 111111111111;
        transform: translate(-0.44rem);
    }

    /*#light > p, #light1 > p, #light2 > p, #light3 > p, #light4 > p {
        width: 10rem;
        margin: 0;
        height: 1.06rem;
        position: fixed;
        background-color: #262626;
        bottom: calc(60% - 1.06rem);
        z-index: 10021111111;
        border-bottom: 1px solid #67603a;
        text-align: center;
        line-height: 1.06rem;
        font-size: 0.546rem;
        color: #ffe668;
    }*/
    .header-light{
        display: flex;
        align-items: center;
        color: #333;
        padding: 8px 16px;
    }
    .header-light p{
        flex: 1;
        font-size: 14px;
        text-align: center;
    }
    .header-light img{
        width: 18px;
    }
    .footer-info {
        width: 100%;
        height: 100vh;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(0, 0, 0, 0.16);
        z-index: 999999999999999999;
        display: none;
        font-size: 0.346rem;
        color: #000;
    }
    .fotter-box{
        width: 64%;
        display: flex;
        flex-flow: column nowrap;
        justify-content: center;
        padding: 24px 12px;
        background: #fff;
        border-radius: 6px;
        transform: translateY(-50%);
        margin: 50vh auto;
    }
    .header-box{
        display: flex;
        align-items: center;
        padding-bottom: 24px;
    }
    .header-box >h3{
        font-size: 15px;
        flex: 1;
        text-align: center;
    }
    .header-box img{
        width: 18px;
    }
    .fotter-box p{
        padding: 8px 0;
        text-align: center;
        font-size: 13px;
    }
</style>
<body>
<div class="zhicwl-csplr" style="padding-bottom:25px;position: fixed;top: 0;z-index: 99999999999999999999; height: 30rem;padding-top: 18px">

    <div class="zhicwl-yrlof" style="margin:0 auto; display: none;">
        <div class="zhicwl-arwort">
            <div class="zhicwl-arwort-div">
                <dl class="zhicwl-tc-01 display-box box-align-center">
                    <dt class="on"><span>猜庄闲</span></dt>
                </dl>
            </div>
        </div>
    </div>


    <section class="zhicwl-qiejlf">
        <!--猜庄闲-->
        <div class="zhicwl-qiejlf-tab zhicwl-qiejlf-tab-04" style="background: #fff;">
            <div class="zhicwl-ldprta display-box box-align-center" style="margin-top:0;">
                <h2 class="zhicwl-ldprta-left box-flex" style="padding-top:0.9rem;">猜庄闲和</h2>
                <div class="zhicwl-repavb zhicwl-guanb">
                    <img src="/Public/Home/img/backIcon.png" alt="" style="position: relative;top:0.7rem;">
                </div>
            </div>

            <div class="zhicwl-keapr">
                <div class="zhicwl-akodr">
                    <dl>
                        <dt>
                            <div>
                                <span>庄</span>
                                <samp>x <?php echo C('hundred_z_point');?></samp>
                            </div>
                        </dt>
                        <dt>
                            <div>
                                <span>和</span>
                                <samp>x <?php echo C('hundred_h_point');?></samp>
                            </div>
                        </dt>
                        <dt>
                            <div>
                                <span>闲</span>
                                <samp>x <?php echo C('hundred_x_point');?></samp>
                            </div>
                        </dt>

                        <dt style="width:50%;">
                            <div>
                                <span>庄对</span>
                                <samp>x <?php echo C('hundred_zxd_point');?></samp>
                            </div>
                        </dt>
                        <dt style="width:50%;">
                            <div>
                                <span>闲对</span>
                                <samp>x <?php echo C('hundred_zxd_point');?></samp>
                            </div>
                        </dt>

                        <dt style="width:50%;">
                            <div>
                                <span>三宝</span>
                            </div>
                        </dt>
                        <dt style="width:50%;">
                            <div>
                                <span>对子</span>
                            </div>
                        </dt>
                    </dl>
                </div>
            </div>
        </div>
        <!--/猜庄闲-->

    </section>

</div>
<!--/弹窗-北京赛车-->

<div id="input-chatting">
    <img class="zhicwl-xiaz" src="/Public/Home/img/binding.png" alt="">
    <input type="text" name="" id="textarea">
    <button id="postDataOk">发送</button>
    <button id="selectMenu" style="background: #7181e8;margin-left: 9px;">更多</button>
</div>
<div id="menu-ul-t" class="menu-ul-t">
    <dl class="menu-ul">
        <!-- <dd>
            <a href="/Home/User/index">
                <img src="/Public/Home/img/menuList4.png" alt="">
                <p>我的</p>
            </a>
        </dd>
        <dd>
            <a href="/Home/Run/index">
                <img src="/Public/Home/img/menuList1.png" alt="">
                <p>大厅</p>
            </a>
        </dd>
        <dd>
            <a href="<?php echo U('Home/Fen/addpage');?>?type=pk10">
                <img src="/Public/Home/img/menuList2.png" alt="">
                <p>充值</p>
            </a>
        </dd>
        <dd>
            <a href="<?php echo U('Home/Fen/xiapage');?>?type=pk10">
                <img src="/Public/Home/img/menuList3.png" alt="">
                <p>提现</p>
            </a>
        </dd> -->
        <dd>
            <a href="javascript:void(0)" onclick="openRecord()">
                <img src="/Public/Home/img/menuList3.png" alt="">
                <p>注单</p>
            </a>
        </dd>
        <dd>
            <a href="javascript:void(0)"onclick="openKjssc()">
                <img src="/Public/Home/img/menuList4.png" alt="">
                <p>记录</p>
            </a>
        </dd>
        <dd>
            <a href="javascript:void(0)" onclick="openRule()">
                <img src="/Public/Home/img/menuList2.png" alt="">
                <p>规则</p>
            </a>
        </dd>
        <dd>
            <a href="javascript:void(0)" id="lastmenu">
                <img src="/Public/Home/img/menuList4.png" alt="">
                <p>余额</p>
            </a>
        </dd>
    </dl>
</div>
<div id="light1" class="white_content1">
    <div class="header-light">
        <p>注单</p>
        <img src="/Public/Home/img/backIcon.png" onclick="closeRecord()" alt="">
    </div>
    <table class="tb-continer" style="margin-top:0.28rem;">
        <thead>
        <tr class="title">
            <th>进项:  <span id="jin">0</span></th>
            <th>出项:  <span id="chu">0</span></th>
            <th>输赢:  <span id="ying">0</span></th>
        </tr>
        </thead>
    </table>
    <table class="tb-continer">
        <thead>
        <tr class="title">
            <th>投注选项</th>
            <th>投注金额</th>
            <th>期数</th>
            <th>输赢结果</th>
        </tr>
        </thead>
        <tbody id="danzhuList">

        </tbody>
    </table>
</div>
<div id="light2" class="white_content2">
    <div class="header-light">
        <p>开奖记录</p>
        <img src="/Public/Home/img/backIcon.png" onclick="closeKjssc()" alt="">
    </div>
    <div class="kjssc_wrapper" style="margin-top:0.28rem;">
        <div class="tab-content">
            <div id="app1"></div>
        </div>
    </div>
</div>
<div id="light3" class="white_content3">
    <div class="header-light">
        <p>游戏规则</p>
        <img src="/Public/Home/img/backIcon.png" onclick="closeRule()" alt="">
    </div>
    <div class="sscrule" style="color:#333;padding:0 0.3rem; margin-top:0.28rem;">
        <br>
        <div class="">
            <h4 class="cl-orange" style="font-size:0.4rem; color:#333;">【百家乐游戏介绍】</h4><br>
            <p>百家乐，英文为Baccarat，baccarat在意大利语中的意思就是“0”，源起于法国的一种纸牌游戏，流行于欧洲各地赌场。20世纪由叶汉先生将Baccarat从美国引入澳门，并为其起了一个具有东方色彩的名字－－百家乐。时至今日，百家乐是世界各地赌场中受欢迎的赌戏之一。在澳门的赌场中，百家乐赌桌的数目更是全球赌场之中最多。<br/>
        </div>
        <br>

    </div>
    <div class="">
            <h4 class="cl-orange" style="font-size:0.4rem; color:#333;">【基本玩法】</h4><br>
            <p>
                使用3～8副，每副52张纸牌，洗在一起，置於发牌盒中，由荷官从其中分发。各家力争手中有两三张牌总点数为9或接近9，K、Q、J和10都计为0，其他牌按牌面计点。计算时，将各家手中的牌值相加，但仅论最後一位数字。当场付赌金最多者为庄家。
                客人根据自己的想法可任意选择庄、闲、和与对子或其他任意一门下注。
            </p>
        </div>
        <br>
        <div class="">
            <h5 class="cl-blue" style="font-size:0.4rem; color:#333;">
                【发牌与博牌】

            </h5><br>
            <p>百家乐一般用8副牌，洗牌后8副牌放在发派箱内。庄、闲家双方每局均会收到至少两张牌，但不超过三张。第一及第三张牌发给“闲家”，第二及第四张牌则发给“庄家”。至于要否博牌则根据博牌规则（或称牌例）决定。百家乐跟廿一点不同，玩家可下注于庄（Banker）或闲（Player），并无限制。<br>
            </p>
            <br>
            <h5 class="cl-blue" style="font-size:0.4rem; color:#333;">
                【点数计算方法】

            </h5><br>
            <p>在百家乐中，Ace的扑克牌被算作1点；从2到9的扑克牌依点数不变，均依照其显示的点数计算；10、J、Q及K的扑克牌则被算作零点（有些赌场以10点计）。当所有牌的点数总和超过9时，则只算总数中的个位。因此，一个8和一个9的牌点大小为：7点（8 + 9 = 17）。因百家乐中只计算扑克牌的个位数值，因此可能的最大点数为9点（如一个4 和一个 5：4 + 5 = 9），最少则为0点，又称baccarat（如一个10 和一个 Q：10 + 10 = 20，只算个位是 0）。<br>
            </p>
            <br>

        </div>

        <h5 class="cl-blue" style="font-size:0.4rem; color:#333;">
            【游戏赔率】
        </h5>
        <br>
        <p>
            ■赔率：<br />
            <small>
                庄，含本<?php echo C('hundred_z_point');?>倍<br />
                闲，含本<?php echo C('hundred_x_point');?>倍<br />
                和，含本<?php echo C('hundred_h_point');?>倍<br />
                庄对，含本<?php echo C('hundred_zxd_point');?>倍<br />
                闲对，含本<?php echo C('hundred_zxd_point');?>倍<br />
            </small>
            ■庄限额：<?php echo C('hundred_z_money');?><br />
            ■闲限额：<?php echo C('hundred_x_money');?><br />
            ■和限额：<?php echo C('hundred_h_money');?><br/>
            ■庄对/闲对限额：<?php echo C('hundred_zxd_money');?>(总项限额)<br />
        </p>


        <br>

        <!--<br> <h4 class="cl-orange" style="font-size:0.4rem; color:#fff98d;">每期下注：总额<?php echo C('hundred_max_money');?>封顶</h4><br>-->
        <h4 class="cl-orange" style="font-size:0.4rem; color:#333;">【说明】</h4><br>
        <p>
            <!-- ■没带名次默认投第一名，如「双/100」第一名双$100、「123/100」第一名123号各$100<br /> -->
            ■下注时因各地网路品质不定，可能有1-2秒延迟，以系统判定是否下注成功为准。<br />

        </p>
    </div>

</div><div class="footer-info" id="footer-info">
    <div class="fotter-box">
        <div class="header-box">
            <h3>账户余额</h3>
            <img src="/Public/Home/img/backIcon.png" id="clouse-footer" alt="">
        </div>
        <p>余额：<span class="money"><?php echo ($userinfo["points"]); ?></span></p>
        <p>用户：<span class="Name"><?php echo ($userinfo["nickname"]); ?></span></p>
    </div>
</div>
<div class="main-box">
    <!--第一行（表单、积分在线人数）-->
    <div class="top"
         style="width:100%;height:18px;background-color:rgb(237, 237, 237);position: fixed;top:0;z-index:9999;">
        <div class="keyborad">
            <p>
                <span>1</span>
                <span>2</span>
                <span>3</span>
                <span>4</span>
                <span>5</span>
                <span>/</span>
            </p>
            <p>
                <span>6</span>
                <span>7</span>
                <span>8</span>
                <span>9</span>
                <span>0</span>
            </p>
            <p>
                <span>庄</span>
                <span>闲</span>
                <span>和</span>
                <span>庄对</span>
                <span>闲对</span>
            </p>
            <p>
                <strong class="qc">清除</strong>
                <strong class="jt">←</strong>
                <strong class="fs">发送</strong>
                <strong class="close">关闭</strong>
            </p>
        </div>
    </div>
</div>

<div id="load" style="text-align: center;font-size: 14px;color:#fff;">加载中...</div>
<div class="chatting" style="display: none;margin-bottom:25rem !important;padding-top: 4.8rem;overflow-y: scroll;">
    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; if($vo['type'] == 'admin'): ?><div class="chatting-li qtr orange">
            <!--class="chatting-li qtr orange"-->
                <div class="portrait"><img src="<?php echo ($vo["head_img_url"]); ?>"/></div>
                <div class="content">
                    <small><span class="name"><?php echo ($vo["from_client_name"]); ?></span>
                        <time><?php echo ($vo["time"]); ?></time>
                    </small>
                    <p><?php echo (stripcslashes(htmlspecialchars_decode($vo["content"]))); ?></p>

                </div>
            </div><?php endif; ?>
        <?php if($vo['type'] == 'system'): ?><div class="chatting-li qtr pink">
                <div class="portrait"><img src="<?php echo ($vo["head_img_url"]); ?>"/></div>
                <div class="content">
                    <small><span class="name"><?php echo ($vo["from_client_name"]); ?></span>
                        <time><?php echo ($vo["time"]); ?></time>
                    </small>
                    <p><?php echo (stripcslashes(htmlspecialchars_decode($vo["content"]))); ?></p>

                </div>
            </div><?php endif; ?>
        <?php if($vo['type'] == 'say'): ?><div class="chatting-li">
                <div class="portrait"><img src="<?php echo ($vo["head_img_url"]); ?>"/></div>
                <div class="content">
                    <small><span class="name"><?php echo ($vo["from_client_name"]); ?></span>
                        <time><?php echo ($vo["time"]); ?></time>
                    </small>
                    <p><?php echo (stripcslashes(htmlspecialchars_decode($vo["content"]))); ?></p>

                </div>
            </div><?php endif; ?>
        <?php if($vo['type'] == 'error' && $userinfo['id'] == $vo['uid']): ?><div class="chatting-li qtr green">
                <div class="portrait"><img src="<?php echo ($vo["head_img_url"]); ?>"/></div>
                <div class="content">
                    <small><span class="name"><?php echo ($vo["from_client_name"]); ?></span>
                        <time><?php echo ($vo["time"]); ?></time>
                    </small>
                    <p><?php echo (stripcslashes(htmlspecialchars_decode($vo["content"]))); ?></p>

                </div>
            </div><?php endif; ?>
        <?php if($vo['type'] == 'say_error' && $userinfo['id'] == $vo['uid']): ?><div class="chatting-li">
                <div class="portrait"><img src="<?php echo ($vo["head_img_url"]); ?>"/></div>
                <div class="content">
                    <small><span class="name"><?php echo ($vo["from_client_name"]); ?></span>
                        <time><?php echo ($vo["time"]); ?></time>
                    </small>
                    <p><?php echo (stripcslashes(htmlspecialchars_decode($vo["content"]))); ?></p>

                </div>
            </div><?php endif; endforeach; endif; else: echo "" ;endif; ?>
</div>
<!--<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>-->
<script src="/Public/Home/js/jquery.min.js"></script>
<!--聊天-->
<script type="text/javascript" src="/Public/worker/js/swfobject.js"></script>
<script type="text/javascript" src="/Public/worker/js/web_socket.js"></script>
<script src="/Public/tables/tables.js"></script>
<script src="/Public/layer/layer.js"></script>
<script type="text/javascript">
    var ua = window.navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == 'micromessenger') {
        //在微信中打开需要的操作
        $('#input-chatting').removeClass('input-chatting').addClass('input-chattings')
        $('#menu-ul-t').attr('style','bottom:56px;top: auto;')
    } else {
    //不在微信中打开
       $('#input-chatting').removeClass('input-chattings').addClass('input-chatting')
    }
    function openRecord() {
        //获取数据
        $.post('/Home/Run/hundredRecord',{
            game:'hundred',
            page:0
        },function(e){
            var con=eval('('+e+')').content;
            var con_zhongji=eval('('+e+')').zongji;
            var str='';
            con.forEach((it)=>{
                if(it.type.indexOf('/')!=-1){
                    var sp=it.type.split('/');
                    var spa=it.points.split('/');
                    for(let i=0;i<sp.length;i++){
                        str+=` <tr class="${it.odds_points>0?'yin':'shu'}"><td>${sp[i]}</td><td>${spa[i]}</td><td>${it.number}</td><td>${it.is_add==="0"?'未结算':it.odds_points>0?'赢':it.odds_points<0?'输':'退回'}</td></tr>`
                    }
                }else{
                    str+=`<tr class="${it.odds_points>0?'yin':'shu'}">
                            <td>${it.type}</td>
                            <td>${it.points}</td>
                            <td>${it.number}</td>
                            <td>${it.is_add==="0"?'未结算':it.odds_points>0?it.odds_points:it.odds_points<0?it.odds_points:'退回'}</td>
                           </tr>`
                }
            });
            document.querySelector('#danzhuList').innerHTML=str;
            document.querySelector('#jin').innerHTML=eval('('+e+')')['zongji']['jin'];
            document.querySelector('#chu').innerHTML=eval('('+e+')')['zongji']['chu'];
            document.querySelector('#ying').innerHTML=eval('('+e+')')['zongji']['ying'];
            document.getElementById('light1').classList.add('active-white');
            document.getElementById('fade1').style.display = 'block';
        });
    }

    function closeRecord() {
        document.getElementById('light1').classList.remove('active-white');
        // document.getElementById('light1').style.display = 'none';
        document.getElementById('fade1').style.display = 'none';
    }

    function openKjssc() {
        $.post('/Home/Run/kjhundred',[],function(e){
            var tb=new Tables('#app1',6);
            var list=eval('('+e+')').content;
            for(let i=0;i<list.length;i++){
                let it=list[i];
                let h=Math.floor(i%6+1);
                let l=Math.floor(i/6+1);
                let as=it.award_numbers.split(',');
                as.forEach((at)=>{
                    switch(at){
                        case '庄':
                            tb.addZ(h,l);
                            break;
                        case '闲':
                            tb.addX(h,l);
                            break;
                        case '和':
                            tb.addH(h,l);
                            break;
                        case '庄对':
                            tb.addZd(h,l);
                            break;
                        case '闲对':
                            tb.addXd(h,l);
                            break;
                    }
                })
            }

            document.getElementById('light2').classList.add('active-white');
            document.getElementById('fade2').style.display = 'block';
        });
    }

    function closeKjssc() {
        document.getElementById('light2').classList.remove('active-white');
        document.getElementById('fade2').style.display = 'none';
    }

    function openRule() {
        document.getElementById('light3').classList.add('active-white');
        document.getElementById('fade3').style.display = 'block';
    }

    function closeRule() {
        document.getElementById('light3').classList.remove('active-white');
        document.getElementById('fade3').style.display = 'none';
    }
    $('#lastmenu').click(function(){
        $('#footer-info').toggle()
    })
    $('#clouse-footer').click(function(){
        $('#footer-info').hide()
    })
    $("#selectMenu").click(function(){
        $("#menu-ul-t").slideToggle()
        return false
    })
    $(document).click(function(){
        $("#menu-ul-t").hide()
    })
    setTimeout(function () {
        $('#load').css('display', 'none');
        $('.chatting').css('display', 'block');
    }, 1500);
    $('.jp_btn').click(function () {
        if ($('.keyborad').is(":hidden")) {
            $('.keyborad').show();
        } else {
            $('.keyborad').hide();
        }

    })

    $('.keyborad span').click(function () {
        var value = $(this).text();
        var input_value = $('#textarea').val();
        $('#textarea').val(input_value + value);
    })

    $('.keyborad .qc').click(function () {
        $('#textarea').val('');
    })

    $('.keyborad .jt').click(function () {
        var input_value = $('#textarea').val();
        var str = input_value.substr(0, input_value.length - 1);
        $('#textarea').val(str);
    })

    $('.keyborad .fs').click(function () {
        $('.submit_btn').click();
        $('.keyborad').hide();
    })

    $('.keyborad .close').click(function () {
        $('.keyborad').hide();
    })

    $('.submit_btn').click(function () {
        $('.keyborad').hide();
    })
    // $('#textarea').blur(function(){
    // 	$('.keyborad').hide();
    // })


    document.onkeydown = function (event) {
        e = event ? event : (window.event ? window.event : null);
        if (e.keyCode == 13) {
            onSubmit();
            return false;
        }
    }
    $('#postDataOk').click(onSubmit);

    if (typeof console == "undefined") {
        this.console = {
            log: function (msg) {
            }
        };
    }
    WEB_SOCKET_SWF_LOCATION = "/Public/worker/swf/WebSocketMain.swf";
    WEB_SOCKET_DEBUG = true;
    var ws, name;

    // 连接服务端
    function connect() {
        // 创建websocket
        ws = new WebSocket("ws://" + document.domain + ":15100");
        // 当socket连接打开时，发送登录信息
        ws.onopen = function () {
            // login_data = '{"type":"pong"}';
            var name = "<?php echo ($userinfo["nickname"]); ?>";
            // 登录
            var userid = "<?php echo ($userinfo["id"]); ?>";
            var login_data = '{"type":"login","client_name":"' + name.replace(/"/g, '\"') + '","client_id":"' + userid + '"}';
            console.log("websocket握手成功，发送登录数据:" + login_data);
            ws.send(login_data);
        };
        // 当有消息时根据消息类型显示不同信息
        ws.onmessage = onmessage;
        ws.onclose = function () {
            console.log("连接关闭，定时重连");
            connect();
        };
        ws.onerror = function () {
            console.log("出现错误");
        };
    }
    $(connect);
    var inte = parseInt(Math.random() * 12 + 1);
    function  magArr(content) {
        var strArr=[];
        try {
            var arr=eval(content);
            for(let key in arr){
                strArr.push(key+'/'+arr[key]);
            }
        }catch(e){
            strArr.push(content);
        }
        return strArr;
    }
    function maginfo(content) {
        try{
            var cont=eval("("+content+")");
        }catch (e){
            return content;
        }
        let show='';
        for(let key in cont){
            show+=key+"/"+cont[key]+" "
        }
        return show;
    }
    var money_kou=0;
    function onmessage(e) {
        var rate = 0;
        var robot_rate = e['robot_rate'] ? e['robot_rate'] : 3;
        switch (e['robot_rate']) {
            case 5:
                rate = 5;
                break;
            case 4:
                rate = 10;
                break;
            case 3:
                rate = 25;
                break;
            case 2:
                rate = 35;
                break;
            case 1:
                rate = 45;
                break;
            default:
                rate = 25;
                break;
        }
        var data = eval("(" + e.data + ")");
        // console.log(data);
        switch (data['type']) {
            // 服务端ping客户端
            case 'ping':
                $('#xs').html(data.content + {C: ('online')});
                ws.send('{"type":"pong"}');
                inte--;
                if (inte == 0) {
                    ws.send('{"type":"robot"}');
                    console.log(e.data);
                    inte = parseInt(Math.random() * rate + 1) + 2;
                }
                break;
            // 登录 更新用户列表
            case 'login':
                console.log(data['client_name'] + "登录成功");
                break;
            // 发言
            case 'say':
                say(data['uid'], data['from_client_name'], data['head_img_url'], data['content'], data['time']);
                break;
            // 用户退出 更新用户列表
            case 'logout':
                break;
            case 'broadcast':
            //alert('client');

            //房管
                case 'admin':
                var strArr=magArr(data["content"]);
                function show(){
                    if ('<?php echo ($userinfo["id"]); ?>' == data['uid']) {
                        strArr.forEach((it)=> {
                            $(".chatting").prepend('<div class="chatting-li qtr orange"><div class="portrait"><img src="' + data['head_img_url'] + '"/></div><div class="content"><small><span class="name">' + data["from_client_name"] + '</span><time>' + data["time"] + '</time></small><p>' + it+ '</p></div></div>');
                        });
                    } else {
                        strArr.forEach((it)=> {
                            $(".chatting").prepend('<div class="chatting-li qtr orange"><div class="portrait"><img src="' + data['head_img_url'] + '"/></div><div class="content"><small><span class="name">' + data["from_client_name"] + '</span><time>' + data["time"] + '</time></small><p>' + it + '</p></div></div>');
                        });
                    }
                }
                if(data['content'].indexOf('竞猜成功')!==-1){
                    $('.money',window.top.document).html(Number($('.money',window.top.document).html()) - money_kou);
                    money_kou=0;
                }else if(data['code']+''===''+400){
                    setTimeout(show,200);
                    break;
                }
                show();
                break;
            //系统
            case 'system':
                var strArr=magArr(data["content"]);
                if ('<?php echo ($userinfo["id"]); ?>' == data['uid']) {
                    strArr.forEach((it)=> {
                        $(".chatting").prepend('<div class="chatting-li qtr green"><div class="portrait"><img src="' + data['head_img_url'] + '"/></div><div class="content"><small><span class="name">' + data["from_client_name"] + '</span><time>' + data["time"] + '</time></small><p>' +it + '</p></div></div>');
                    });
                } else {
                    strArr.forEach((it)=> {
                        $(".chatting").prepend('<div class="chatting-li qtr orange"><div class="portrait"><img src="' + data['head_img_url'] + '"/></div><div class="content"><small><span class="name">' + data["from_client_name"] + '</span><time>' + data["time"] + '</time></small><p>' +it+ '</p></div></div>');
                    });
                }
                break;
            //积分减
            case 'points':
                $('#sy').html((parseFloat($('#sy').html()) - data['content']).toFixed(1));
                break;
            //积分加
            case 'pointsadd':
                $('.money',window.parent.document).html((parseFloat($('.money',window.parent.document).html()) + data['points']).toFixed(1));
                parent.layer.msg('恭喜竞猜成功');
                // alert('aaaa')
                break;
            //重载
            case 'reload':
                if ('<?php echo ($userinfo["id"]); ?>' == 9) {
                    window.location.href = window.location.href;
                }
                break;
            //切换
            case 'switch':
                parent.location.reload();
                break;
            case 'addpoints':
                $('.money').html(data['points']);
                break;
        }
    }
    var def_content='';
    function wsTz(tz, money) {
        var headimgurl = '<?php echo ($userinfo["headimgurl"]); ?>';
        var from_client_name = '<?php echo ($userinfo["nickname"]); ?>';
        def_content=tz.replace(/5555/g, money);
        def_content=eval('('+def_content+')');
        Object.keys(def_content).forEach((e)=>{
            ws.send('{"type":"say","client_name":"' + from_client_name + '","headimgurl":"' + headimgurl + '","content":{"'+e+'":'+def_content[e]+'}}');
        });

        $('#textarea').val('');
        $(".zhicwl-qiejlf .zhicwl-qiejlf-tab .zhicwl-keapr dt").removeClass('on');
        $(".zhicwl-fxalpr-an1").removeClass('on');
    }

    function checkData() {
        var tz = [];
        var hms = "";
        //获取数据
        var fq = window.parent;
        let list = document.querySelectorAll('.zhicwl-qiejlf-tab .zhicwl-akodr dt.on');
        /*        let userName=fq.document.querySelector('.footer-info .Name').innerText;
                let headimgurl=null;*/
        if (list != null && list.length > 0) {
            //存在
            let moneyList = {};
            list.forEach((it) => {
                moneyList[it.querySelector('span').innerText] = 5555;
            });
            console.log(JSON.stringify(moneyList));
            return JSON.stringify(moneyList);
        } else {
            alert("请投注");
            return false;
        }
    }
    function GetPostData(oVal,ignoreCase=true){
        let gz={
            '庄':['Z','庄'],
            '闲':['X','闲'],
            '庄对':['ZD','庄对'],
            '闲对':['XD','闲对'],
            '和':['H','和'],
            '对子':['对子','DZ'],
            '三宝':['三宝','SB'],

        };
        let type={
            '全撤':['全撤','CQ','Q'],
            '撤庄':['撤庄','CZ'],
            '撤闲':['撤闲','CX'],
            '撤和':['撤和','CH'],
            '撤对子':['撤对子','CDZ'],
            '撤三宝':['撤三宝','CSB'],
            '撤和':['撤和','CH'],
            '梭哈庄':['梭哈庄','SHZ'],
            '梭哈闲':['梭哈闲','SHX'],
            '梭哈庄':['梭哈庄','SHZ'],
            '梭哈庄对':['梭哈庄对','SHZD'],
            '梭哈闲对':['梭哈闲对','SHXD'],
        };
        let val=oVal;
        try{
            if(ignoreCase){
                val=val.toLocaleLowerCase();
                Object.keys(gz).forEach((key)=>{
                    let obj=gz[key];
                    obj.forEach((vl,key)=>{
                        obj[key]=vl.toLocaleLowerCase();
                    })
                });
                Object.keys(type).forEach((key)=>{
                    let obj=type[key];
                    obj.forEach((vl,key)=>{
                        obj[key]=vl.toLocaleLowerCase();
                    })
                });
            }
            //优先判断是否存在type
            let typeName=null;
            Object.keys(type).forEach((key)=>{
                let obj=type[key];
                if(!typeName && obj.includes(val)){
                    typeName=key;
                }
            });
            if(typeName){
                return typeName+'/1';
            }
            let name=val.match(/[a-zA-Z\u4e00-\u9fa5]+/i)[0];
            let money=val.match(/\d+/)[0];
            let overName=null;
            Object.keys(gz).forEach((key)=>{
                let obj=gz[key];
                console.log(obj);
                if(!overName && obj.includes(name)){
                    overName=key;
                }
            });
            return overName?overName+'/'+money:oVal;
        }catch (e) {
            return oVal;
        }
    }
    // 提交对话
    function onSubmit() {
        var headimgurl = '<?php echo ($userinfo["headimgurl"]); ?>';
        var input = document.getElementById("textarea");
        var input_value = GetPostData(input.value);
        console.log(input_value);
        var from_client_name = '<?php echo ($userinfo["nickname"]); ?>';
        if (input.value == '') {
            $('#textarea').focus();
            return false;
        }

        // ws.send('{"type":"say","client_name":"' + from_client_name + '","headimgurl":"' + headimgurl + '","content":{"闲": 600,"庄": 300}}');
        let list = input_value.split('/');
        ws.send('{"type":"say","client_name":"' + from_client_name + '","headimgurl":"' + headimgurl + '","content":{"' + list[0] + '":' + list[1] + '}}');
        $('#textarea').val('');
        //$('#dialog').scrollTop(0);
    }
    // 发言
    function say(uid, from_client_name, head_img_url, content, time) {
        if(!content){
            content=def_content;
        }
        var strArr=magArr(content);
        if ('<?php echo ($userinfo["id"]); ?>' == uid) {
            var arr=content;
            console.log(arr);
            strArr.forEach((it)=>{
                $(".chatting").prepend('<div class="chatting-li"><div class="portrait"><img src="'+ head_img_url +'"/></div><div class="content"><small><span class="name">' + from_client_name + '</span><time>' + time +' </time></small><p>'+it+'</p></div></div>');

            })
        } else {
            strArr.forEach((it)=>{
                $(".chatting").prepend('<div class="chatting-li"><div class="portrait"><img src="' + head_img_url + '"/></div><div class="content"><small><span class="name">' + from_client_name + '</span><time>' + time + '</time></small><p>' + it + '</p></div></div>');
            })
        }
    }
</script>
<!--聊天-->

<!--推送-->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.7/socket.io.min.js"></script>-->
<script src="/Template/Home/Run/js/socket.io.min.js"></script>
<!--http://buck.msd1946.com/Template/Home/Run/js/socket.io.min.js-->
<script>
    var uid = '<?php echo ($userinfo["id"]); ?>';
</script>
<script>
    function escape2Html(str) {
        var arrEntities = {'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"'};
        return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) {
            return arrEntities[t];
        });
    }

    $(document).ready(function () {
        // 连接服务端
        var socket = io('http://' + document.domain + ':12223');
        // 连接后登录
        socket.on('connect', function () {
            socket.emit('login', uid);
        });
        var fpTime=null;
        var sptime=10;
        var tasm=null;
        // 后端推送来消息时
        socket.on('new_msg', function (msg) {
            var data = eval("(" + escape2Html(msg) + ")");
            if (data['type'] == '3' || data['type'] == '4' || data['type'] == '1' || data['type'] == '2') {
                return false;
            }
            if(data["clear"] && data["clear"]==="1"){
                if(data['to']){
                    if(data["to"] == '<?php echo ($userinfo["id"]); ?>'){
                        $('.money',window.parent.document).html(($('.money',window.parent.document).html()*1)+data["content"]*1);
                    }
                }else{
                    $('.money',window.parent.document).html(($('.money',window.parent.document).html()*1)+data["content"]*1);
                }
                return;
            }
            var time = data['time'];
            var content = data['content'];
            if (data['points'] && data['to'] == '<?php echo ($userinfo["id"]); ?>') {
                var points = parseFloat($('#sy').html()) + parseFloat(data['points']);
                $('#sy').html(points);
            }

            $(".chatting").prepend('<div class="chatting-li qtr pink"><div class="portrait"><img src="/Public/main/img/system.jpg"/></div><div class="content"><small><span class="name">客服</span><time>' + time + '</time></small><p>' + content + '</p></div></div>');
            if(data.content.indexOf('已封盘')!=-1){
                return;
            }
            if(data.content.indexOf('距离封盘')!=-1){
                sptime=10;
                $('#zy_loead_top',window.parent.document).show()
                clearInterval(fpTime);
                fpTime=setInterval(()=>{
                    sptime--;
                    if(sptime<=0){
                        $('#zy_loead_top',window.parent.document).hide();
                        clearInterval(fpTime);
                        return;
                    }
                    $('#zy_loead_top',window.parent.document).html(sptime)
                },1000)
            }
        });
        socket.on('new_msg26_0', function (msg) {
            var data = eval("(" + escape2Html(msg) + ")");
            if (data['type'] == '3' || data['type'] == '4' || data['type'] == '1' || data['type'] == '2') {
                return false;
            }
            if(data["clear"] && data["clear"]==="1"){
                if(data['to']){
                    if(data["to"] == '<?php echo ($userinfo["id"]); ?>'){
                        $('.money',window.parent.document).html(($('.money',window.parent.document).html()*1)+data["content"]*1);
                    }
                }else{
                    $('.money',window.parent.document).html(($('.money',window.parent.document).html()*1)+data["content"]*1);
                }
                return;
            }
            var time = data['time'];
            var content = data['content'];
            if (data['points'] && data['to'] == '<?php echo ($userinfo["id"]); ?>') {
                var points = parseFloat($('#sy').html()) + parseFloat(data['points']);
                $('#sy').html(points);
            }
            $(".chatting").prepend('<div class="chatting-li qtr pink"><div class="portrait"><img src="/Public/main/img/system.jpg"/></div><div class="content"><small><span class="name">客服</span><time>' + time + '</time></small><p>' + content + '</p></div></div>');
            if(data.content.indexOf('已封盘')!=-1){
                return;
            }
            if(data.content.indexOf('距离封盘')!=-1){
                sptime=10;
                $('#zy_loead_top',window.parent.document).show()
                clearInterval(fpTime);
                fpTime=setInterval(()=>{
                    sptime--;
                    if(sptime<=0){
                        $('#zy_loead_top',window.parent.document).hide();
                        clearInterval(fpTime);
                        return;
                    }
                    $('#zy_loead_top',window.parent.document).html(sptime)
                },1000)
            }
        });
    });
</script>
<!--推送-->
<script src="/Template/Home/Run/js/zhicwl-z.js"></script>
</body>
</html>